home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text.html;
-
- import java.util.EmptyStackException;
- import java.util.Hashtable;
- import java.util.Stack;
- import java.util.Vector;
-
- class StyleSheet$SearchBuffer {
- static Stack searchBuffers = new Stack();
- Vector vector = null;
- StringBuffer stringBuffer = null;
- Hashtable hashtable = null;
-
- void empty() {
- if (this.stringBuffer != null) {
- this.stringBuffer.setLength(0);
- }
-
- if (this.vector != null) {
- this.vector.removeAllElements();
- }
-
- if (this.hashtable != null) {
- this.hashtable.clear();
- }
-
- }
-
- Hashtable getHashtable() {
- if (this.hashtable == null) {
- this.hashtable = new Hashtable();
- }
-
- return this.hashtable;
- }
-
- StringBuffer getStringBuffer() {
- if (this.stringBuffer == null) {
- this.stringBuffer = new StringBuffer();
- }
-
- return this.stringBuffer;
- }
-
- Vector getVector() {
- if (this.vector == null) {
- this.vector = new Vector();
- }
-
- return this.vector;
- }
-
- static StyleSheet$SearchBuffer obtainSearchBuffer() {
- StyleSheet$SearchBuffer var0;
- try {
- var0 = (StyleSheet$SearchBuffer)searchBuffers.pop();
- } catch (EmptyStackException var1) {
- var0 = new StyleSheet$SearchBuffer();
- }
-
- return var0;
- }
-
- static void releaseSearchBuffer(StyleSheet$SearchBuffer var0) {
- var0.empty();
- searchBuffers.push(var0);
- }
- }
-